//
//  User.h
//  CarLifes
//
//  Created by yu on 2017/8/4.
//  Copyright © 2017年 jpas. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "BaseModel.h"
#import <AMapLocationKit/AMapLocationKit.h>

typedef NS_ENUM(NSInteger, LoginType) {
    LoginTypeAccount = 0, // 帐号登录
    LoginTypeVin // 设备号登录
};

@class DeptModel;

@interface User :BaseModel

// 当前应用程序版本
@property (nonatomic, copy) NSString *verson;

// 用户Id
@property (nonatomic, copy) NSString *userId;

@property (nonatomic, copy) NSString *nickName;

@property (nonatomic, copy) NSString *deptName;

@property (nonatomic, copy) NSString *avatar;

@property (nonatomic, copy) NSString *mobile;

@property (nonatomic, copy) NSString *email;

/** 公司账户*/
@property (nonatomic, copy) NSString *account;
@property (nonatomic, copy) NSString *password;

/** 车架号账户*/
@property (nonatomic, copy) NSString *vinAccount;
@property (nonatomic, copy) NSString *vinPassword;


@property (nonatomic, copy) NSNumber *saveValue;

@property (nonatomic) BOOL isSavePsd;

@property (nonatomic, assign) LoginType loginType;

@property (nonatomic, strong) DeptModel *deptModel;


@property (nonatomic, copy) NSString *searchText;

/** 工单*/
// 保存工单帐号
@property (nonatomic) BOOL isSaveWorkorderAccount;
@property (nonatomic, copy) NSString *workorderAccount;
@property (nonatomic, copy) NSNumber *saveWorkorderAccountStatus;

/** 家访*/
@property (nonatomic, copy) NSString *visitorName;
@property (nonatomic, copy) NSString *visitorMobile;

+ (User *)sharedUser;

- (void)logout;

/*定位位置相关*/
///纬度
@property (nonatomic, copy) NSString *latitude;
///经度
@property (nonatomic, copy) NSString *longitude;
///格式化地址
@property (nonatomic, copy) NSString *formattedAddress;
///省/直辖市
@property (nonatomic, copy) NSString *province;
///市
@property (nonatomic, copy) NSString *city;
///区
@property (nonatomic, copy) NSString *district;
///街道名称
@property (nonatomic, copy) NSString *street;

- (void)updateUserLoction:(CLLocation *)location reGeocode:(AMapLocationReGeocode *)reGeocode;


@end


#pragma mark - 部门 -
@interface DeptModel : BaseModel

// 部门Id
@property (nonatomic, copy) NSString *deptId;
// 部门Id(列表切换账户存储的Id)
@property (nonatomic, copy) NSString *childDeptId;
// 上级部门Id
@property (nonatomic, copy) NSString *parentDeptId;

@property (nonatomic, copy) NSString *deptName;

@end


